Use the command M-x irc to connect using the defaults. See Configuration, if you want to change the defaults.
Use C-u M-x irc if you don't want to use the defaults, eg. if you want to connect to a different network, or connect to the same network using a different nick. This will prompt you for four things:
irc.freenode.net is such a server for the
Freenode network. Freenode provides the network “for
the Free and Open Source Software communities, for
not-for-profit organizations and for related communities and
organizations.”
user-login-name is alex, and this
nick is already in use, you might for example get assigned
the nick alex`.
#emacs, the channel about all things Emacs, or
join #rcirc, the channel about
rcirc.When you have answered these
questions, rcirc will create a server buffer, which
will be named something like *irc.freenode.net*, and
a channel buffer for each of the channels you wanted to join.
To talk in a channel, just type what you want to say in a channel buffer, and press <RET>.
If you want to paste multiple lines, such as source code, you can use C-c C-c to edit your message in a separate buffer. Use C-c C-c to finish editing. You still need to press <RET> to send it, though. Generally, IRC users don't like people pasting more than around four lines of code, so use with care.
Once you are connected to multiple channels, or once you've turned you attention to other buffers in Emacs, you probably want to be notified of any activity in channels not currently visible. All you need to do is switch channel tracking on using M-x rcirc-track-minor-mode. To make this permanent, add the following to your init file:
(rcirc-track-minor-mode 1)
Use C-c C-<SPC> to switch to these buffers.